<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>服务器控制</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="/static/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="/static/css/app.css">
    <style>
        .mui-content-padded {
            margin: 10px;
        }
    </style>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-back mui-pull-left"></a>
    <h1 class="mui-title">服务器控制</h1>
</header>
<div class="mui-content">
    <div class="mui-content-padded">
        <button type="button" id="serverInfoBtn" class="mui-btn mui-btn-block">获取服务器状态信息到Server酱</button>
        <button type="button" id="service" class="mui-btn mui-btn-block">查看服务器服务</button>
        <button type="button" class="mui-btn mui-btn-block" id="cmdBtn">运行服务命令</button>
        <div id="info">
        </div>
    </div>

</div>
</body>
<script src="/static/js/mui.min.js"></script>
<script src="/static/js/jquery-1.11.3.min.js"></script>

<script>
    //mui初始化
    mui.init({
        swipeBack: true //启用右滑关闭功能
    });
    var info = document.getElementById("info");
    var key = document.getElementById("key");
    document.getElementById("serverInfoBtn").addEventListener('tap', function () {
        mui.post('/command/getServerInfo',function (data) {
                if (data.code === 200) {
                    mui.toast('已经发送服务器信息到Server酱');
                } else {
                    mui.toast(data.msg);
                }
            }, 'json'
        );
    });
    $("#service").click(function () {
        window.location.href = "/ipList";
    });
    $("#cmdBtn").click(function () {
        window.location.href = "/cmd";
    });
</script>

</html>